package org.luxor.cloud.authentication.component.handler;

import org.luxor.commons.security.handler.AbstractAuthenticationSuccessEventHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;

/**
 * 登陆成功事件处理器
 *
 * @author Mr.Yan  @date: 2020/9/18
 */
@Component
public class AuthenticationSuccessEventHandler extends AbstractAuthenticationSuccessEventHandler {
    private static final Logger logger = LoggerFactory.getLogger(AuthenticationSuccessEventHandler.class);

    /**
     * 处理登录成功事件
     *
     * @param authentication 登录对象
     */
    @Override
    public void handle(Authentication authentication) {
        logger.info("用户：{} 登录成功", authentication.getPrincipal());
    }

}
